{% extends 'base.html' %}
{% block content %}
    <div class="container">
        <div class="page-header">
            <h1></h1>
        </div>
        <div class="row">
            <div class="col">
                <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.hanyang.gov.cn%2FUpFiles%2FFile%2F20190521090017941.jpg&refer=http%3A%2F%2Fwww.hanyang.gov.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1627895497&t=eb563eccc97d60412f50d5c99d1e09c3"
                     class="img-fluid rounded mx-auto d-block" alt="学习强国">
            </div>
        </div>
        <div class="row">
            <form class="form-inline col-md-12" method="post" action="{% url 'XxqgResult' %}">
                <div class="col-md-11">
                    {% csrf_token %}
                    <input class="form-control mr-sm-2 my-4 my-sm-2" name="keyword" type="text" placeholder="输入1~2个关键词"
                           aria-label="Search" style="width:100%">
                </div>
                <div class="col-md-1.5">
                    <button class="btn btn-outline-success my-4 my-sm-2 " type="submit">搜索答案</button>
                </div>
            </form>
        </div>
    </div>
    <div class="container">
        <table class="table table-hover table-dark">
            <thead>
            <tr>
                <th scope="col">#</th>
                <th scope="col">匹配答案</th>
            </tr>
            </thead>
            <tbody>
            {% for x in answer_context.data %}
                <tr>
                    <th scope="row">{{ forloop.counter }}</th>
                    <td>{{ x.answer }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>

{% endblock %}